]> dgit.raspbian.org Git - pcre2.git/commitdiff
Backport of pcre2-10.48-Fix-scan-prefix-repeat-reset.patch
authorZoltan Herczeg <zherczeg7@gmail.com>
Sun, 25 Jan 2026 05:38:11 +0000 (06:38 +0100)
committerMatthew Vernon <matthew@debian.org>
Tue, 1 Sep 2026 10:43:48 +0000 (11:43 +0100)
Cherry-pick of 7a33b226fe0dc243cbed47fcbe49025ec4aea125

Fix repeat reset for scan prefix (#875)

(cherry picked from commit f945e356e0ba203a974717af2cff0baee01f1db4)

src/pcre2_jit_compile.c
src/pcre2_jit_test.c

index 175eb68535cfef09257f2466e6d0e655fe14f979..90592c184ffb9cffd59a411aaaa0945b670b7225 100644 (file)
@@ -6107,6 +6107,7 @@ while (TRUE)
       repeat = GET2(cc, 1);
       if (repeat <= 0)
         {
+        repeat = 1;
         chars_end = chars;
         continue;
         }
index a7ade442f33ad1d864dd0d71fc86064826bb588f..b336abea290a42cf48b64cc39d8b343510018f85 100644 (file)
@@ -277,6 +277,7 @@ static struct regression_test_case regression_test_cases[] = {
        { CM, A, 0, 0, "a1277|a1377|bx487", "bX487" },
        { 0, A, 0, 0, "(a|)b*+a", "a" },
        { 0, A, 0, 0 | F_NOMATCH, "(.|.|.|.|.)(|.|.|.|.)(.||.|.|.)(.|.||.|.)(.|.|.||.)(.|.|.|.|)(A|.|.|.|.)(.|A|.|.|.)(.|.|A|.|.)(.|.|.|A|.)(.|.|.|.|A)(B|.|.|.|.)(.|B|.|.|.)(.|.|B|.|.)(.|.|.|B|.)(.|.|.|.|B)xa", "1234567890123456ax" },
+       { 0, A, 0, 0, "(CHAN|LINE)[ab]{0,2}", "LINE" },
 
        /* Greedy and non-greedy ? operators. */
        { MU, A, 0, 0, "(?:a)?a", "laab" },